// Customer Good Component Styles
.customer-good-container {
  padding: 20px;
}

.search-form {
  margin-bottom: 20px;
  padding: 16px;
  background-color: #f5f5f5;
  border-radius: 4px;
}

.form-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.form-field {
  flex: 1;
  min-width: 200px;
}

.button-group {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.table-container {
  margin-top: 20px;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.mat-column-actions {
  width: 120px;
  text-align: center;
}

// Modern styles for Customer Good Component
.card {
  border: none;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  margin-bottom: 24px;
  transition: all 0.3s ease;
  background: #fff;

  &:hover {
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.12);
  }

  .card-header {
    background: linear-gradient(135deg, #0396FF 0%, #0D47A1 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 20px;
    font-weight: 500;
    font-size: 1.1rem;
    border: none;
    display: flex;
    align-items: center;

    i {
      font-size: 1.4rem;
      margin-right: 10px;
    }
  }

  .card-body {
    padding: 24px;
  }
}

.form-group {
  margin-bottom: 1.2rem;
  
  label {
    color: #566a7f;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;

    i {
      margin-right: 6px;
      color: #0396FF;
    }
  }

  .form-control {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 0.6rem 1rem;
    transition: all 0.2s;
    background-color: #f8f9fa;
    
    &:focus {
      border-color: #0396FF;
      box-shadow: 0 0 0 0.2rem rgba(3, 150, 255, 0.15);
      background-color: #fff;
    }

    &::placeholder {
      color: #adb5bd;
      font-size: 0.9rem;
    }
  }

  select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23566a7f' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
  }
}

.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: none;
  letter-spacing: 0.3px;

  i {
    font-size: 1rem;
  }

  &:active {
    transform: translateY(1px);
  }

  &.btn-primary {
    background: linear-gradient(135deg, #0396FF 0%, #0D47A1 100%);
    border: none;
    &:hover {
      background: linear-gradient(135deg, #0277cc 0%, #093777 100%);
    }
  }

  &.btn-success {
    background: linear-gradient(135deg, #28c76f 0%, #1f9d57 100%);
    border: none;
    &:hover {
      background: linear-gradient(135deg, #24b365 0%, #1b8a4c 100%);
    }
  }

  &.btn-info {
    background: linear-gradient(135deg, #00cfe8 0%, #0097a7 100%);
    border: none;
    &:hover {
      background: linear-gradient(135deg, #00b6cc 0%, #00838f 100%);
    }
  }

  &.btn-secondary {
    background: linear-gradient(135deg, #82868b 0%, #5e6064 100%);
    border: none;
    &:hover {
      background: linear-gradient(135deg, #6c707d 0%, #4d4f52 100%);
    }
  }

  &:disabled {
    opacity: 0.7;
    cursor: not-allowed;
  }
}

hr {
  margin: 1.5rem 0;
  opacity: 0.1;
}

// Datatable styles
::ng-deep {
  .ngx-datatable.material {
    box-shadow: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;

    .datatable-header {
      background: #f8f9fa;
      border-bottom: 2px solid #e0e0e0;
      
      .datatable-header-cell {
        color: #566a7f;
        font-weight: 600;
        font-size: 0.9rem;
        padding: 1rem 0.8rem;
        transition: all 0.2s;

        &:hover {
          background: #eef2f5;
        }
      }
    }

    .datatable-body {
      .datatable-body-row {
        border-color: #f0f0f0;
        transition: all 0.2s;
        
        &:hover {
          background: rgba(3, 150, 255, 0.05) !important;
          transform: translateY(-1px);
          box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        }

        .datatable-body-cell {
          padding: 1rem 0.8rem;
          color: #444;
          font-size: 0.9rem;
          line-height: 1.5;
          display: flex;
          align-items: center;

          i {
            color: #0396FF;
            margin-right: 6px;
          }
        }
      }
    }

    .datatable-footer {
      background: #f8f9fa;
      border-top: 1px solid #e0e0e0;
      padding: 8px 16px;

      .datatable-pager {
        li {
          margin: 0 2px;

          a {
            border-radius: 4px;
            padding: 5px 10px;
            color: #566a7f;
            transition: all 0.2s;

            &:hover {
              background: #e9ecef;
            }
          }

          &.active a {
            background: #0396FF;
            border-color: #0396FF;
          }
        }
      }
    }
  }
}

// Responsive adjustments
@media (max-width: 768px) {
  .card-body {
    padding: 16px;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .action-buttons, .search-buttons {
    display: flex;
    gap: 8px;
  }
}

// 状态标签样式
.badge {
  padding: 6px 12px;
  border-radius: 50px;
  font-weight: 500;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  
  i {
    font-size: 0.9rem;
  }

  &.badge-warning {
    background-color: #fff4de;
    color: #ffa800;
    border: 1px solid rgba(255, 168, 0, 0.2);
  }

  &.badge-success {
    background-color: #e8fff3;
    color: #28c76f;
    border: 1px solid rgba(40, 199, 111, 0.2);
  }
}

// 动画效果
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.5s ease-out;
}

// 加载动画
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  
  .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0396FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

// 页面容器样式
:host {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

// 搜索区域样式
.search-form {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);

  .form-group {
    margin-bottom: 1rem;

    label {
      color: #566a7f;
      font-weight: 500;
      font-size: 0.9rem;
      margin-bottom: 0.5rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;

      i {
        color: #0396FF;
        font-size: 1rem;
      }
    }

    .form-control {
      border-radius: 8px;
      border: 1px solid #e0e0e0;
      padding: 0.6rem 1rem;
      transition: all 0.2s;
      background-color: #f8f9fa;
      font-size: 0.9rem;
      
      &:focus {
        border-color: #0396FF;
        box-shadow: 0 0 0 0.2rem rgba(3, 150, 255, 0.15);
        background-color: #fff;
      }

      &::placeholder {
        color: #adb5bd;
      }
    }

    .form-select {
      @extend .form-control;
      padding-right: 2.5rem;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23566a7f' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 1rem center;
    }
  }
}

// 按钮样式
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;

  i {
    font-size: 1rem;
  }

  &:active {
    transform: translateY(1px);
  }

  &.btn-primary {
    background: linear-gradient(135deg, #0396FF 0%, #0D47A1 100%);
    color: white;
    
    &:hover {
      background: linear-gradient(135deg, #0277cc 0%, #093777 100%);
    }
  }

  &.btn-success {
    background: linear-gradient(135deg, #28c76f 0%, #1f9d57 100%);
    color: white;
    
    &:hover {
      background: linear-gradient(135deg, #24b365 0%, #1b8a4c 100%);
    }
  }

  &.btn-info {
    background: linear-gradient(135deg, #00cfe8 0%, #0097a7 100%);
    color: white;
    
    &:hover {
      background: linear-gradient(135deg, #00b6cc 0%, #00838f 100%);
    }
  }

  &.btn-secondary {
    background: #e9ecef;
    color: #566a7f;
    
    &:hover {
      background: #dee2e6;
    }
  }

  &:disabled {
    opacity: 0.7;
    cursor: not-allowed;
  }
}

// 表格样式
::ng-deep {
  .ngx-datatable.material {
    background: white;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;

    .datatable-header {
      background: #f8f9fa;
      border-bottom: 2px solid #e0e0e0;
      
      .datatable-header-cell {
        color: #566a7f;
        font-weight: 600;
        font-size: 0.9rem;
        padding: 1rem;
        transition: all 0.2s;

        &:hover {
          background: #eef2f5;
        }
      }
    }

    .datatable-body {
      .datatable-body-row {
        border-color: #f0f0f0;
        transition: all 0.2s;
        
        &:hover {
          background: rgba(3, 150, 255, 0.05) !important;
          transform: translateY(-1px);
          box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        }

        .datatable-body-cell {
          padding: 1rem;
          color: #444;
          font-size: 0.9rem;
          display: flex;
          align-items: center;

          i {
            color: #0396FF;
            margin-right: 0.5rem;
            font-size: 1rem;
          }
        }
      }
    }

    .datatable-footer {
      background: #f8f9fa;
      border-top: 1px solid #e0e0e0;
      padding: 0.75rem 1rem;

      .datatable-pager {
        margin: 0;
        
        li {
          margin: 0 2px;

          a {
            height: 32px;
            min-width: 32px;
            border-radius: 6px;
            padding: 0.25rem 0.5rem;
            color: #566a7f;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;

            &:hover {
              background: #e9ecef;
            }
          }

          &.active a {
            background: #0396FF;
            color: white;
          }

          &.disabled a {
            opacity: 0.5;
            cursor: not-allowed;
          }
        }
      }
    }
  }
}

// 状态标签样式
.badge {
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  font-weight: 500;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  
  i {
    font-size: 0.9rem;
  }

  &.badge-warning {
    background-color: #fff4de;
    color: #ffa800;
    border: 1px solid rgba(255, 168, 0, 0.2);
  }

  &.badge-success {
    background-color: #e8fff3;
    color: #28c76f;
    border: 1px solid rgba(40, 199, 111, 0.2);
  }
}

// 动画效果
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

// 加载状态
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  border-radius: 12px;
  
  .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0396FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

// 工具栏样式
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;

  .action-buttons, .search-buttons {
    display: flex;
    gap: 0.5rem;
  }
}

// 响应式调整
@media (max-width: 768px) {
  .search-form {
    padding: 15px;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    
    .action-buttons, .search-buttons {
      justify-content: flex-start;
    }
  }
} 